package proxy.d.impl;

import java.lang.reflect.Proxy;

public class IntermediaryJDKProxyFactory {
    public static <T> T create(Object obj){
        IntermediaryInvocationHandler handler=new IntermediaryInvocationHandler();
        handler.setTarget(obj);
        return (T)Proxy.newProxyInstance(obj.getClass().getClassLoader(),
                obj.getClass().getInterfaces(),
                handler);
    }
}
